import FieldValue from "../FieldValue"
import JsonSeriType from "../../base/JsonSeriType"
import FIELD_VALUE_TYPE from "../../constants/commonConstants"

export default class ShowFieldValue extends FieldValue{
	
	#type;
	
	#defaultValue;
	
	#valueInfo;
	
	#comment;
	
	constructor(){
		super(null);
		this.#type = FIELD_VALUE_TYPE.show.BASE.code;
		super.seriType = new JsonSeriType(FIELD_VALUE_TYPE.show.BASE.code,FIELD_VALUE_TYPE.show.BASE.clsPage);
	}
	
	get type(){
		return this.#type;
	}
	
	set type(val){
		this.#type = val;
	}
	
	get defaultValue(){
		return this.#defaultValue;
	}
	
	set defaultValue(val){
		this.#defaultValue = val;
	}
	
	get valueInfo(){
		return this.#valueInfo;
	}
	
	set valueInfo(val){
		this.#valueInfo = val;
	}
	
	get comment(){
		return this.#comment;
	}
	
	set comment(val){
		this.#comment = val;
	}
	
	genSeriObj(){
		
		let ret={
			"value": super.value,
			"type":this.#type,
			"defaultValue":this.#defaultValue,
			"valueInfo":this.#valueInfo,
			"comment":this.#comment
		};
		return ret;
	
	}
	
	seriObj(obj){
		this.#type =  obj.type;
		this.#defaultValue =  obj.defaultValue;
		this.#valueInfo =  obj.valueInfo;
		this.#comment =  obj.comment;
		super.value = obj.value;
	}
	
}